/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sdd.entities;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author T
 */
@Entity
public class Feature implements Serializable {
    private static final long serialVersionUID = 5L;
    
    private Long id;
    private String summary;
    private String description;
    private FeatureCategory category;
    private Product product;
    
    
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Feature)) {
            return false;
        }
        Feature other = (Feature) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sdd.entities.Feature[ id=" + id + " ]";
    }

    /**
     * @return the summary
     */
    public String getSummary() {
        return summary;
    }

    /**
     * @param summary the summary to set
     */
    public void setSummary(String summary) {
        this.summary = summary;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the category
     */
    @ManyToOne
    public FeatureCategory getCategory() {
        return category;
    }

    /**
     * @param category the category to set
     */
    public void setCategory(FeatureCategory category) {
        this.category = category;
    }

    /**
     * @return the products
     */

   
    @ManyToOne
    public Product getProduct() {
        return product;
    }

    /**
     * @param products the products to set
     */
    public void setProduct(Product product) {
        this.product = product;
    }
    
}
